
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Css加载动画</title>

<style>
* {
  box-sizing: border-box;
}

body {
  background-color: #252A34;
}

.wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
      -ms-flex-pack: center;
          justify-content: center;
  width: 100%;
  max-width: 500px;
  height: 200px;
}

.loadingbox {
  width: 30px;
  height: 30px;
  margin: 0 10px;
  border-radius: 0%;
  -webkit-transform: translateY(0) rotate(0deg);
          transform: translateY(0) rotate(0deg);
  -webkit-animation: change 1s infinite alternate;
          animation: change 1s infinite alternate;
}

.loadingbox:nth-child(1) {
  background-color: #FF2E63;
  -webkit-animation-delay: 0.1s;
          animation-delay: 0.1s;
}

/* .loadingbox:nth-child(2) {
  background-color: #08D9D6;
  -webkit-animation-delay: 0.2s;
          animation-delay: 0.2s;
} */

.loadingbox:nth-child(3) {
  background-color: #FF2E63;
  -webkit-animation-delay: 0.3s;
          animation-delay: 0.3s;
}

/* .loadingbox:nth-child(4) {
  background-color: #08D9D6;
  -webkit-animation-delay: 0.4s;
          animation-delay: 0.4s;
} */

.loadingbox:nth-child(5) {
  background-color: #FF2E63;
  -webkit-animation-delay: 0.5s;
          animation-delay: 0.5s;
}

/* .loadingbox:nth-child(6) {
  background-color: #08D9D6;
  -webkit-animation-delay: 0.6s;
          animation-delay: 0.6s;
} */

.loadingbox:nth-child(7) {
  background-color: #FF2E63;
  -webkit-animation-delay: 0.7s;
          animation-delay: 0.7s;
}

/* .loadingbox:nth-child(8) {
  background-color: #08D9D6;
  -webkit-animation-delay: 0.8s;
          animation-delay: 0.8s;
} */

.loadingbox:nth-child(9) {
  background-color: #FF2E63;
  -webkit-animation-delay: 0.9s;
          animation-delay: 0.9s;
}

/* .loadingbox:nth-child(10) {
  background-color: #08D9D6;
  -webkit-animation-delay: 1s;
          animation-delay: 1s;
} */

@-webkit-keyframes change {
  0% {
    -webkit-transform: translateY(0px) rotate(0deg);
            transform: translateY(0px) rotate(0deg);
    border-radius: 0%;
  }
  50% {
    -webkit-transform: translateY(150px) rotate(180deg);
            transform: translateY(150px) rotate(180deg);
    border-radius: 50%;
  }
  100% {
    -webkit-transform: translateY(0px) rotate(360deg);
            transform: translateY(0px) rotate(360deg);
    border-radius: 0%;
  }
}

@keyframes change {
  0% {
    -webkit-transform: translateY(0px) rotate(0deg);
            transform: translateY(0px) rotate(0deg);
    border-radius: 0%;
  }
  50% {
    -webkit-transform: translateY(150px) rotate(180deg);
            transform: translateY(150px) rotate(180deg);
    border-radius: 50%;
  }
  100% {
    -webkit-transform: translateY(0px) rotate(360deg);
            transform: translateY(0px) rotate(360deg);
    border-radius: 0%;
  }
}
</style>
</head>
<body>

<div class="wrapper">
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
	<div class="loadingbox"></div>
</div>

</body>
</html>
